﻿using System.Web.Mvc;

namespace Classified.Web.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            //context.MapRoute(
            //"CountriesList",
            //"admin/country-list/{page}",
            //new { controller = "Admin", action = "CountryList", page = UrlParameter.Optional },
            //new[] { "Classified.Web.Areas.Admin.Controllers" }

            //);
            context.MapRoute(
            "CategoriesSearchById",
            "Categories/{selectId}",
            new { controller = "Classified", action = "Categories", selectId = UrlParameter.Optional },
            new[] { "Classified.Web.Areas.Admin.Controllers" }

            );
            context.MapRoute(
            "Countries",
            "admin/countries",
            new { controller = "Admin", action = "Countries", id = UrlParameter.Optional },
            new[] { "Classified.Web.Areas.Admin.Controllers" }

            );
            context.MapRoute(
            "CountryDelete",
            "admin/country-delete/{id}",
            new { controller = "Admin", action = "DeleteCountry", id = UrlParameter.Optional },
            new[] { "Classified.Web.Areas.Admin.Controllers" }

            );
            context.MapRoute(
             "CountryCreate",
             "admin/country-create/{id}",
             new { controller = "Admin", action = "CreateCountry", id = UrlParameter.Optional },
             new[] { "Classified.Web.Areas.Admin.Controllers" }

             );
            context.MapRoute(
             "CountryEdit",
             "admin/country-edit/{id}",
             new { controller = "Admin", action = "EditCountry", id = UrlParameter.Optional },
             new[] { "Classified.Web.Areas.Admin.Controllers" }

             );
            context.MapRoute(
              "LocationDelete",
              "admin/location-delete/{id}",
              new { controller = "Admin", action = "DeleteLocation", id = UrlParameter.Optional },
              new[] { "Classified.Web.Areas.Admin.Controllers" }

              );

            context.MapRoute(
              "LocationCreate",
              "admin/location-create/{countryId}",
              new { controller = "Admin", action = "CreateLocation", countryId = UrlParameter.Optional },
              new[] { "Classified.Web.Areas.Admin.Controllers" }

              );

            context.MapRoute(
              "LocationEdit",
              "admin/location-edit/{id}",
              new { controller = "Admin", action = "EditLocation", id = UrlParameter.Optional },
              new[] { "Classified.Web.Areas.Admin.Controllers" }

              );
            context.MapRoute(
               "Locations",
               "admin/locations",
               new { controller = "Admin", action = "Locations", id = UrlParameter.Optional },
               new[] { "Classified.Web.Areas.Admin.Controllers" }

               );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { controller = "Admin", action = "Index", id = UrlParameter.Optional },
                new[] { "Classified.Web.Areas.Admin.Controllers" }

                );


            //context.MapRoute(
            //    "Admin_default",
            //    "Admin/{controller}/{action}/{id}",
            //    new { action = "Index", id = UrlParameter.Optional }
            //);
        }
    }
}
